package com.cmlite.model;

import java.io.Serializable;

public class PeopleModel implements Serializable, Cloneable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String mId;
	private String mPeople_ID;

	private boolean isGroup = false;
	private String mField_01;
	private String mField_02;
	private String mField_03;
	private String mField_04;
	private String mField_05;

	private boolean isCheck = false;
	private boolean isColor = true;
	private boolean isSelected = false;

	public PeopleModel() {

	}

	public PeopleModel(String mId, String mPeople_ID, String mField_01,
			String mField_02, String mField_03, String mField_04,
			String mField_05) {
		super();
		this.mId = mId;
		this.mPeople_ID = mPeople_ID;
		this.mField_01 = mField_01;
		this.mField_02 = mField_02;
		this.mField_03 = mField_03;
		this.mField_04 = mField_04;
		this.mField_05 = mField_05;
	}

	public PeopleModel(String mId, String mPeople_ID, String mField_01,
			String mField_02, String mField_03, String mField_04,
			String mField_05, boolean isCheck, boolean isGroup) {
		super();
		this.mId = mId;
		this.mPeople_ID = mPeople_ID;
		this.isGroup = isGroup;
		this.mField_01 = mField_01;
		this.mField_02 = mField_02;
		this.mField_03 = mField_03;
		this.mField_04 = mField_04;
		this.mField_05 = mField_05;
		this.isCheck = isCheck;
	}

	public String getValueByIndex(int index) {
		switch (index) {
		case 1: {
			if (mField_01.equals("")) {
				return "#";
			}
			return mField_01;
		}
		case 2: {
			if (mField_02.equals("")) {
				return "#";
			}
			return mField_02;
		}
		case 3: {
			if (mField_03.equals("")) {
				return "#";
			}
			return mField_03;
		}
		case 4: {
			if (mField_04.equals("")) {
				return "#";
			}
			return mField_04;
		}
		case 5: {
			if (mField_05.equals("")) {
				return "#";
			}
			return mField_05;
		}
		default: {
			if (mId.equals("")) {
				return "#";
			}
			return mId;
		}
		}

	}

	/**
	 * @return the mId
	 */
	public String getmId() {
		return mId;
	}

	/**
	 * @param mId
	 *            the mId to set
	 */
	public void setmId(String mId) {
		this.mId = mId;
	}

	/**
	 * @return the mPeople_ID
	 */
	public String getmPeople_ID() {
		return mPeople_ID;
	}

	/**
	 * @param mPeople_ID
	 *            the mPeople_ID to set
	 */
	public void setmPeople_ID(String mPeople_ID) {
		this.mPeople_ID = mPeople_ID;
	}

	/**
	 * @return the mField_01
	 */
	public String getmField_01() {
		return mField_01;
	}

	/**
	 * @param mField_01
	 *            the mField_01 to set
	 */
	public void setmField_01(String mField_01) {
		this.mField_01 = mField_01;
	}

	/**
	 * @return the mField_02
	 */
	public String getmField_02() {
		return mField_02;
	}

	/**
	 * @param mField_02
	 *            the mField_02 to set
	 */
	public void setmField_02(String mField_02) {
		this.mField_02 = mField_02;
	}

	/**
	 * @return the mField_03
	 */
	public String getmField_03() {
		return mField_03;
	}

	/**
	 * @param mField_03
	 *            the mField_03 to set
	 */
	public void setmField_03(String mField_03) {
		this.mField_03 = mField_03;
	}

	/**
	 * @return the mField_04
	 */
	public String getmField_04() {
		return mField_04;
	}

	/**
	 * @param mField_04
	 *            the mField_04 to set
	 */
	public void setmField_04(String mField_04) {
		this.mField_04 = mField_04;
	}

	/**
	 * @return the mField_05
	 */
	public String getmField_05() {
		return mField_05;
	}

	/**
	 * @param mField_05
	 *            the mField_05 to set
	 */
	public void setmField_05(String mField_05) {
		this.mField_05 = mField_05;
	}

	/**
	 * @return the isCheck
	 */
	public boolean isCheck() {
		return isCheck;
	}

	/**
	 * @param isCheck
	 *            the isCheck to set
	 */
	public void setCheck(boolean isCheck) {
		this.isCheck = isCheck;
	}

	public boolean isGroup() {
		return isGroup;
	}

	public void setGroup(boolean isGroup) {
		this.isGroup = isGroup;
	}

	public boolean isColor() {
		return isColor;
	}

	public void setColor(boolean isColor) {
		this.isColor = isColor;
	}

	@Override
	public String toString() {
		return "PeopleModel [mId=" + mId + ", mPeople_ID=" + mPeople_ID
				+ ", isGroup=" + isGroup + ", mField_01=" + mField_01
				+ ", mField_02=" + mField_02 + ", mField_03=" + mField_03
				+ ", mField_04=" + mField_04 + ", mField_05=" + mField_05
				+ ", isCheck=" + isCheck + ", isColor=" + isColor + "]";
	}

	public String[] getPeopleArray() {
		return new String[] { mId, mPeople_ID, mField_01, mField_02, mField_03,
				mField_04, mField_05 };
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		return super.clone();
	}

	public boolean isSelected() {
		return isSelected;
	}

	public void setSelected(boolean isSelected) {
		this.isSelected = isSelected;
	}
}
